package commands;

import IA.InformationAggregator;
import IA.MenuItem;
import IA.Service;

public class CmdOrderItem extends Command {

    private MenuItem item;
    private Service _s;

    public CmdOrderItem(InformationAggregator IA, Service s, MenuItem Item) {
        super(IA);
        _s = s;
        item = Item;
    }

    @Override
    public java.lang.Object execute() {
        _s.orderItem(item.getName(), item.getCurrentPrice(), item.getPrepTime());
        item.decrementDishesAvail();
        ia.getKitchenQueue().add(_s.getItem(_s.getNumItems() - 1));
        return null;
    }
}